

package com.hazelcast.jet.impl.exception;

import com.hazelcast.jet.JetException;
import com.hazelcast.jet.impl.TerminationMode;

import javax.annotation.Nonnull;
import java.io.Serial;

public class JobTerminateRequestedException extends JetException {

    @Serial
    private static final long serialVersionUID = 1L;

    private final TerminationMode mode;

    public JobTerminateRequestedException(@Nonnull TerminationMode mode) {
        super(mode.name());
        this.mode = mode;
    }

    @Nonnull
    public TerminationMode mode() {
        return mode;
    }
}
